package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.alipaymch.AlipayMchAuthQuery;
import com.uzai.console.entity.AlipayMchAuth;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

/**
 * @Auther: liuqi
 * @Date: 2022/09/27 17:34
 * @Description:
 */
@Repository
public interface AlipayMchAuthMapper {
    void insert(AlipayMchAuth alipayMchAuth);

    AlipayMchAuth selectById(@Param("id") Long id, @Param("merId") Long merId);

    AlipayMchAuth get(@Param("partnerAppId") String partnerAppId, @Param("authAppId") String authAppId, @Param("userId") String userId, @Param("merId") Long merId);

    void updateById(AlipayMchAuth alipayMchAuth);

    void updateRemarkAndTransferinfoById(AlipayMchAuth alipayMchAuth);

    void updateByUserAndPartnerAppIdAndAuthAppId(AlipayMchAuth alipayMchAuth);

    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<AlipayMchAuth> findByList(Page<AlipayMchAuth> page, @Param("query") AlipayMchAuthQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<AlipayMchAuth> findByList(@Param("query") AlipayMchAuthQuery query);
}
